package com.djj.nanny.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.djj.nanny.entity.ChatMessage;
import com.djj.nanny.entity.ChatSession;

import java.util.List;
import java.util.Map;

public interface ChatService {
    Page<ChatSession> getChatSessions(Long userId, Integer pageNum, Integer pageSize);

    void markMessagesAsRead(Long sessionId, Long userId);

    boolean isStaffUser(Long userId, Long staffId);

    Map<String, Object> createSession(Long userId, Long staffId);

    ChatMessage sendMessage(Long senderId, Long receiverId, String content) throws Exception;

    ChatSession getOrCreateSession(Long senderId, Long receiverId);

    void handleMessage(String messageContent, Long senderId) throws Exception;

    void deleteMessage(Long messageId);

    void clearSessionMessages(Long sessionId);

    void deleteSession(Long sessionId);

    int getUnreadMessageCount(Long userId);

    Page<ChatMessage> getChatMessages(Long sessionId, Integer pageNum, Integer pageSize);

    Page<ChatMessage> getAllChatMessages(Integer pageNum, Integer pageSize, String content);

    void fillUserInfo(List<ChatMessage> messages);
}